Protests turned ugly as thousands gathered to display their discontent at prime minister Pedro Sanchez's amnesty talks with Catalan nationalist parties.